home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19990725-20000114 / 000211_news@columbia.edu _Mon Oct 18 12:26:34 1999.msg < prev    next >
Internet Message Format  |  2020-01-01  |  4KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id MAA10960
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Mon, 18 Oct 1999 12:26:34 -0400 (EDT)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id MAA13569
  7.     for kermit.misc@watsun.cc.columbia.edu; Mon, 18 Oct 1999 12:08:51 -0400 (EDT)
  8. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  9. Subject: Re: [Q] how to take an action on closing network connection OR redefine a command
  10. From: Matt Swift <swift@alum.mit.edu>
  11. Message-ID: <m21zas3b4l.fsf@aleph.swift.xxx>
  12. Date: 18 Oct 1999 12:08:10 -0400
  13. Organization: Shore.Net/Eco Software, Inc; (info@shore.net)
  14. To: kermit.misc@columbia.edu
  15.  
  16.  
  17.  
  18. Thanks very much for your reply.
  19.  
  20. >>"F" == Frank da Cruz <fdc@watsun.cc.columbia.edu> writes:
  21.  
  22.     F> As an aside, this would work very nicely in C-Kermit with:
  23.  
  24.     F> pipe ssh <hostname>
  25.  
  26.     F> except that the UNIX ssh client does not use standard i/o.  Go figure.
  27.     F> (You can pipe rlogin, various telnet clients, cu, etc, but not ssh.)
  28.     F> (And of course we can't put ssh in Kermit itself due to licensing and
  29.     F> legal considerations.)
  30.  
  31. I have heard several places that OpenBSD is developing an open-source
  32. ssh replacement, and I saw a link yesterday that called the project
  33. "psst".  Worth requesting the option for it to use stdio and thus work
  34. with kermit's PIPE?  Perhaps this would only encourage more people to
  35. use RSA public key over the better soln of a kerberized IKSD -- but
  36. Kerberos has its own problems with open-source status, and I think
  37. kermit would gain popularity if it worked with psst.
  38.  
  39.     F> You can't define a macro to supersede a built-in command.  Imagine the
  40.     F> mischief you could cause if you could...  
  41.  
  42. For someone like me who has worked for a decade with TeX, such
  43. "mischief" is a standard way to get things done.
  44.  
  45.     F> If you really want to execeute
  46.     F> a macro whose name is the same as built-in command, use "do", as in
  47.     F> "define close ..." and then "do close".
  48.  
  49. Aha, I thought there might have been something like this, and there it
  50. is, staring me in the face on p. 216.
  51.  
  52. For the moment, I've gotten in the habit of all the time typing a
  53. substitute for 'close' -- 'closet'.
  54.  
  55.     assign closet close
  56.     def acslog {
  57.         spawn tunnel start acs
  58.         assign closet { run tunnel stop acs, close, assign closet { close }}
  59.         set host localhost:9002 /telnet
  60.         login
  61.     }
  62.  
  63.  
  64.     F> Before 7.0 is released, we might also be able to add an ON_CLOSE macro
  65.     F> capability, similar to the current ON_EXIT macro.
  66.  
  67. It seems to me that such a thing would be useful in more situations
  68. than the one I described.  It would make the macro additionally useful
  69. if a variable were set indicating the cause of the close.  Since there
  70. only seem to be a small number of possible reasons for a close
  71. ('close', 'hangup', a remote disconnect, a lost connection, ...) this
  72. seems not a big change to many parts of the code to set a flag.  This
  73. would permit, for instance, an ON_CLOSE macro to notify a user the
  74. connection closed for an unexpected reason and to refrain from notice
  75. if it was an expected reason.
  76.  
  77.     F> Something like this maybe?  (C-Kermit 7.0):
  78.  
  79.     F> define isp {
  80.     F> run tunnel start isp
  81.     F> set host localhost:9000 /telnet
  82.     F> if fail end 1 Can't make connection
  83.     F> login
  84.     F> if fail end 1 Login failure
  85.     F> while ( > \v(ttyfd) -1 ) {
  86.     F> connect
  87.     F> }
  88.     F> shut
  89.     F> }
  90.  
  91. I tried something like this, and it works as expected, but it does not
  92. permit me to move back and forth from the connection to the Kermit
  93. command line.  The first time you his ESC-c the connection is shut
  94. down.